package com.lkd.service.impl;

import com.lkd.entity.Users;
import com.lkd.mapper.UsersMapper;
import com.lkd.service.IUserservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements IUserservice {
    @Autowired
    private UsersMapper usersMapper;
    @Override
    public Users login(Users users) {
        return usersMapper.selectUserBySelective(users);
    }

    @Override
    public Users checkUser(Users users) {
        return usersMapper.checkUser(users);
    }

    @Override
    public Users login2(Users users) {
        return usersMapper.selectUserByIdName(users);
    }


    @Override
    public int addUser(Users users){
        return usersMapper.insertSelective(users);
    }

    @Override
    public int deleteUser(Users users) {
        return usersMapper.deleteByPrimaryKey(Long.valueOf(users.getAccountId()));
    }

    @Override
    public int updateUser(Users users) {
        return usersMapper.updateByPrimaryKeySelective(users);
    }


}
